﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace Automted_Bank_teller
{
    public class Login_Process : DatabaseConnection
    {
        public static string Client_IDs;
        public static string Client_PIN_Code;

        public void Select_login()
        {
            cmd.CommandText = "Select * From Clients Where client_id ='"+Client_IDs+"'and pin_code ='"+Client_PIN_Code+"'";

            SqlDataReader Selector = cmd.ExecuteReader();

            while (Selector.Read())
            {
                if (Selector.HasRows == true)
                {
                    global_var.G_Client_PIN_Code = Client_PIN_Code.ToString(); //to path data into the another form 
                    global_var.G_Client_ID = Client_IDs.ToString();  //to path data into the another form 

                    ClientsFunction clnt_fun = new ClientsFunction();
                    clnt_fun.ShowDialog();

                    //ClientLoginForm log = new ClientLoginForm();
                    //log.Close();

                    }

                }
            }



        }

    }



